<div id="tab-system" class="HuiTab">
	<div class="tabBar cl">
		<span onclick="HtmlRender('${BASE}/admin/cms/slide/list')">幻灯片列表</span>
		<span onclick="HtmlRender('${BASE}/admin/cms/slide/add')">添加幻灯片</span>
		<span class="current">幻灯片分类列表</span>
		<span onclick="HtmlRender('${BASE}/admin/cms/slide/addCat')">添加幻灯片分类</span>
	</div>
</div>
<div class="cl pd-5 bg-1 bk-gray mt-20"> 
	<span class="l">
		<a href="javascript:;" onclick="list_del()" class="btn btn-danger size-S radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
	</span>
</div>
<div class="dataTables_wrapper no-footer">
<table class="table table-border table-bordered table-bg table-striped table-hover">
	<thead>
		<tr class="text-c">
			<th width="25"><input type="checkbox" name="" value=""></th>
			<th width="40">ID</th>
			<th width="150">分类名称</th>
			<th width="150">分类标识</th>
			<th>描述</th>
			<th width="110">操作</th>
		</tr>
	</thead>
	<tbody>
		<tr class="text-c">
			<td>&nbsp;</td>
			<td>0</td>
			<td>默认分类</td>
			<td>&nbsp;</td>
			<td>默认分类</td>
			<td class="td-manage">不允许修改</td>
		</tr>
	<% for(obj in list){ %>
		<tr class="text-c"><td><input type="checkbox" value="${obj.id}" name="table_checkbox_id"></td>
			<td>${obj.id}</td>
			<td>${obj.name}</td>
			<td>${obj.idname}</td>
			<td>${obj.remarks}</td>
			<td class="td-manage text-r">
				<a class="btn btn-secondary size-MINI" href="javascript:;" title="编辑" onclick="list_edit('${obj.id}')"><i class="Hui-iconfont">&#xe6df;</i> 编辑</a> 
				<a class="btn btn-danger size-MINI" href="javascript:;" title="删除" onclick="list_del('${obj.id}')"><i class="Hui-iconfont">&#xe6e2;</i> 删除</a>
			</td>
		</tr>
	<% } %>
	</tbody>
</table>
</div>
<script type="text/javascript">
function list_del(id){
	var select_ids = "";
	if(id){
		select_ids=id;
	}else{
	    $("input[name='table_checkbox_id']:checked").each(function(){
	    	select_ids+=$(this).val()+",";   
	    });
	    if(""==select_ids){
	    	layer.msg('请先选择要删除的数据！', {icon: 3,offset: '45px'});
	    	return false;
	    }
	}
	layer.confirm('确认删除所选记录?', {icon: 3, title:'警告'}, function(index){	    
	    layer.close(index);
	    HtmlRender("${BASE}/admin/cms/slide/delCat",{ids:select_ids});
	});
}
function list_edit(id,state){
    HtmlRender("${BASE}/admin/cms/slide/editCat",{id:id});
}

$(function(){
	table_checkbox_all();
})
function list_addSlide(id){
	HtmlRender("${BASE}/admin/cms/slide/add",{parentId:id});
}
</script>